package com.heima.search.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.search.pojo.UserSearchDto;
import com.heima.search.service.ApAssociateWordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: JW
 * @Description: TODO
 * @DateTime: 2022-02-18 16:01
 **/
@RestController
@RequestMapping("/api/v1/associate")
public class ApAssociateWordsController {

    @Autowired
    private ApAssociateWordsService apAssociateWordsService;

    /**
     * @Author: JW
     * @Description:  TODO 联想词查询
     * @Date: 16:03 2022-02-18
     * @Param: [userSearchDto]
     * @return: com.heima.model.common.dtos.ResponseResult
    **/
    @PostMapping("/search")
    public ResponseResult search(@RequestBody UserSearchDto userSearchDto) {

        return apAssociateWordsService.search(userSearchDto);
    }
}
